<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript" charset="utf-8">
var admin_log_datagrid;
var admin_log_searchForm;
$(function(){

	admin_log_searchForm = $('#admin_log_searchForm').form();
	  $("#admin_log_searchButton").bind('click', function(){   
		  
		  admin_log_search(); 
	    }); 
	  $("#admin_log_CleanSearchButton").bind('click', function(){   
		  
		  admin_log_cleanSearch();
    }); 
	  admin_log_datagrid=$('#admin_log_datagrid').datagrid({
		url : '${pageContext.request.contextPath}/logAction!dataGrid.action',
		title:'日志信息查询',
		iconCls:'icon-search',
		toolbar:'#admin_log_toolbar',
		fit : true,
		border : false,
		//animate : true,
		//singleSelect : false,	//false是打开全选功能
		striped:true,
		idField : 'id',
		rownumbers: true,		//显示行号
		fitColumns : true,		//显示横向滚动条
		pagination : true,
		pageSize : 20,
		pageList : [ 10, 20, 30, 40, 50 ],
		sortName:'cjsj',
		sortOrder:'desc',
		columns : [[{
					title:'账号',
					field:'user',
					width:100,
					align : 'center',
					sortable:true,
				},{
					title : 'IP',
					field : 'ip',
					width : 80,
					align : 'center',
					sortable:true,
					
			
				},{
					title : '日志',
					field : 'log',
					width : 80,
					align : 'center',
					sortable:true,
				},{
					title : '时间',
					field : 'cjsj',
					width : 80,
					align : 'center',
					sortable:true,
				}]],
		});});
		function admin_log_search() {
			admin_log_datagrid.datagrid('load', serializeObject(admin_log_searchForm));
			
		}
		function admin_log_cleanSearch() {
			admin_log_datagrid.datagrid('load', {});
			admin_log_searchForm.find('input').val('');
		}
		
		
		function admin_log_export_excel() {
			var url1 = '${pageContext.request.contextPath}/logAction!exporLogExcel.action?user='+$('#user').val()
			+'&startCjsj='+$('#startCjsj').datetimebox("getValue")
			+'&endCjsj='+$('#endCjsj').datetimebox("getValue");
			window.open (url1,'newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
			
		}
		
		
</script>
<div id="admin_log_layout" class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false">
		<div id="admin_log_toolbar" class="datagrid-toolbar" style="height: auto;display: none;">
			<fieldset>
				<legend>筛选</legend>
					<form id="admin_log_searchForm">
						<table class="admin_log_searchForm datagrid-toolbar" style="width: 100%;height: 100%;">
						<tr>
						<td>
						<label>用户账号:&nbsp;</label><input name="user" id="user" />
						<label>查询日期:&nbsp;</label><input name="startCjsj" id="startCjsj" editable="fasle" class="easyui-datetimebox"/>&nbsp;至&nbsp;<input name="endCjsj" id="endCjsj" editable="fasle" class="easyui-datetimebox"/>
						<a href='javascript:void(0);' id="admin_log_searchButton" class='easyui-linkbutton' data-options="iconCls:'icon-search'">查询</a>
						<a href='javascript:void(0);' id="admin_log_CleanSearchButton" class='easyui-linkbutton' data-options="iconCls:'icon-cancel'">清空</a>
						</td>
						</tr>
						</table>
					</form>
			</fieldset>
			<div>
				<a class="easyui-linkbutton" iconCls="icon-xz" onclick="admin_log_export_excel();" plain="true" href="javascript:void(0);">Excel导出</a>
			</div>
		</div>
		<table id="admin_log_datagrid"></table>
	</div>
</div>